<template>
  <div>
    <input type="text" v-model="msg" />
    <p>{{ msg }}</p>

    <input type="text" v-model="obj.a" />
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
      msg: "小飞棍来喽",
      obj: {
        a: "abc",
      },
    };
  },
  computed: {},
  watch: {
    msg(nowValue, oldValue) {
      console.log(nowValue, oldValue);
    },
    obj: {
      handler(nowValue, oldValue) {
        console.log(nowValue, oldValue);
      },
      deep: true,
      setImmediate: true,
    },
  },
  created() {},
  methods: {},
};
</script>

<style scoped></style>
